﻿namespace Way.Bus.WMS.ST.Model
{
    using System;
    using System.Runtime.CompilerServices;
    using Way.Bus.Model;
    using Way.EAP.DataAccess.Entity;
    using System.Collections.Generic;

    [EntityClassAttribut("ST_TransportCoordinates", "运输坐标", IsOnAppendProperty = true)]
    public class TransportCoordinates : BusinessBase, IPropertyValueType
    {
        [EntityForeignKey(typeof(ST_PackList), "ID")]
        [EntityField(8)]
        public int ParentID { get; set; }

        [EntityControl("时间", false, true, 1), EntityField(0x12)]
        public DateTime TransportTime { get; set; }

        [EntityControl("X坐标", false, true, 2), EntityField(0x12)]
        public string X { get; set; }

        [EntityControl("Y坐标", false, true, 3), EntityField(0x12)]
        public string Y { get; set; }
        [EntityControl("状态", false, true, 4), EntityField(0x12)]
        [ValueTypeProperty]
        public int DD { get; set; }
        [EntityControl("运单号", false, true, 5), EntityField(0x12)]
        public string code { get; set; }

        PropertyValueType[] IPropertyValueType.GetValueType(ValueTypeArgs valueArgs)
        {
            List<PropertyValueType> list = new List<PropertyValueType>();
            if (valueArgs.ColumnName == "DD" && valueArgs.TableName == this.ToString())
            {
                PropertyValueType v1 = new PropertyValueType();
                v1.Value = "0";
                v1.Text = "起点";
                PropertyValueType v2 = new PropertyValueType();
                v2.Value = "1";
                v2.Text = "运输中";
                PropertyValueType v3 = new PropertyValueType();
                v3.Value = "2";
                v3.Text = "卸货点";
                PropertyValueType v4 = new PropertyValueType();
                v4.Value = "3";
                v4.Text = "终点";
                list.Add(v1);
                list.Add(v2);
                list.Add(v3);
                list.Add(v4);
            }
            return list.ToArray();
        }
    }
}

